<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <link rel="stylesheet" type="text/css" href="/public/static/h-ui/css/H-ui.min.css" />
</head>
<body>
<article class="cl pd-20">
    <form action="" method="post" class="form form-horizontal" id="">
        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-3" style="text-align: right;"><span class="c-red">*</span>相册名称：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <select class="select" size="1" id="group_id" style="width: 60%;">
                    {volist name="group" id="g"}
                        <option value="{$g.group_id}">{$g.group_name}</option>
                    {/volist}
                </select>
            </div>
        </div>
        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
                <input class="btn btn-primary radius" onclick="addSuppAjax()" type="button" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>
<input type="hidden" value="{$pic_id_array}" id="pic_id_array">
<script type="text/javascript" src="/public/js/jquery-2.1.1.js"></script>
<script type="text/javascript" src="/public/static/layer/2.4/layer.js"></script>
<script type="text/javascript">
    //添加相册
    function addSuppAjax() {
        var group_id = $("#group_id").val();
        var pic_id_array = $("#pic_id_array").val();
            $.ajax({
                type : "post",
                url : "{:url('images/zhan_img_box')}",
                data : {
                    'group_id':group_id,
                    'pic_id_array':pic_id_array,
                },
                success : function(data) {
                    if(data['code']>0){
                        layer.msg('转移成功!',{icon:1,time:1000},function () {
                            window.parent.location.reload();
                        });
                    }
                    else{
                        layer.msg('转移失败！',{icon:5,time:1000});
                    }
                }
            });
    }
</script>
</body>
</html>